YAHOO.namespace("gosearch.go");
YAHOO.namespace("gosearch.go.formularyboard");
// define several class used in formularyboard page section

(function(){    
    /**
     * define a YAHOO.gosearch.go.formularyboard.Formularyboard class
     * @constructor
     */
    YAHOO.gosearch.go.formularyboard.Formularyboard = function(){
        this.goBoard = new YAHOO.gosearch.go.GoBoard();
        this.controlPanel = new YAHOO.gosearch.go.formularyboard.ControlPanel();

    };
    YAHOO.gosearch.go.formularyboard.Formularyboard.prototype = {
        /**
         * render html in some other container.
         * @return an element with a board ,a controlPanel and some other stuffs
         */
        render:function(container){
            var el = document.createElement("div");
            el.className = "default-formular-container";
            el.appendChild(this.goBoard.render());
            el.appendChild(this.controlPanel.render());
            container.innerHTML = ""
            container.appendChild(el);
        }
      
    };


    /**
     * define ControlPanel which contains "next step"、"last step" and some other buttons.
     * @constructor
     */
    YAHOO.gosearch.go.formularyboard.ControlPanel = function(){

    };
    YAHOO.gosearch.go.formularyboard.ControlPanel.prototype = {
        /**
         * render html in some other container.
         * @return an element with a ControlPanel
         */
        render:function(){
            var el = document.createElement("div");
            el.className = "default-control-panel";
            var html = "<div class='comments'><textarea rows='15' width='150' readonly='true'></textarea></div>";
            html += "<span id='next-step' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Next Step' id='next-step-button'>Next Step</button></span><span class='icon'></span></span>";
            html += "<span id='last-step' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Last Step' id='last-step-button'>Last Step</button></span><span class='icon'></span></span>";
            html += "<span id='regret' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Regret' id='regret-button'>Regret</button></span><span class='icon'></span></span>";
            html += "<span id='resign' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Resign' id='resign-button'>Resign</button></span><span class='icon'></span></span>";
            html += "<span id='start' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Start' id='start-button'>Start</button></span><span class='icon'></span></span>";
            html += "<span id='done' class='yui-button yui-push-button'><span class='first-child'><button type='button' title='Done' id='done-button'>Done</button></span><span class='icon'></span></span>";
            el.innerHTML = html;
            return el;
        }
    };
    
})();
